﻿
Namespace LightSwitchApplication

    Public Class Reservations

        Private Sub AssetName_Compute(ByRef result As String)
            ' Set result to the desired field value
            If Not AssetInformation Is Nothing Then
                result = Me.AssetInformation.Name
            End If

        End Sub

        Private Sub DateReservedOut_Validate(results As EntityValidationResultsBuilder)
            ' results.AddPropertyError("<Error-Message>")
            If DateReservedOut <= Date.Now Then
                results.AddPropertyError("Reservation date should be today or in the future.")
            End If

            If DateReservedOut >= DateExpectedReturn Then
                results.AddPropertyError("Expected return date must be after Reservation date.")
            End If
        End Sub

     
    End Class

End Namespace
